package com.b2bpsssm.controller.material.commodity;


import com.b2bpsssm.common.R;
import com.b2bpsssm.pojo.GroupCommodity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "组合商品页面",tags = "组合商品接口Api")
public class GroupCommodityController {

    /*
     * 商品页页码每页条数查询
     * */
    @RequestMapping(value = "/commodity/queryGroupCommodityByPageLimit",method = RequestMethod.GET)
    @ApiOperation(value = "查询组合商品",notes = "依靠当前页码和每页条数进行查询",httpMethod = "",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页码",required = true),
            @ApiImplicitParam(name = "limit",value = "每页条数",required = true)
    })
    @ResponseBody
    public R queryGroupCommodityByPageLimit(Integer page, Integer limit){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 新增组合商品
     * */
    @RequestMapping(value = "/commodity/addGroupCommodity",method = RequestMethod.POST)
    @ApiOperation(value = "新增组合商品",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gro_Com_Id",value = "组合商品编号主键",required = true),
            @ApiImplicitParam(name = "gro_Com_Name",value = "组合商品名称",required = true),
            @ApiImplicitParam(name = "gro_Com_Cla",value = "商品分类",required = true),
            @ApiImplicitParam(name = "gro_Com_Price",value = "组合商品价格",required = true),
            @ApiImplicitParam(name = "gro_Com_Putaway_Date",value = "上架日期",required = true),
            @ApiImplicitParam(name = "gro_Com_Status",value = "状态（1:上架,2:下架,3:删除）默认1",required = true),
            @ApiImplicitParam(name = "gro_Com_Details",value = "商品详情（组合商品以 商品1编号+商品2编号... 形式）/(以单独商品编号)",required = true),
            @ApiImplicitParam(name = "gro_Com_Create_Date",value = "创建时间（可前端传输，也可后端直接获取系统当前时间）",required = true),
            @ApiImplicitParam(name = "gro_Com_Remark",value = "备注",required = true)
    })
    @ResponseBody
    public R addCommodity(GroupCommodity groupCommodity){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 编辑组合商品
     * */
    @RequestMapping(value = "/commodity/updateGroupCommodity",method = RequestMethod.POST)
    @ApiOperation(value = "新增组合商品",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gro_Com_Id",value = "组合商品编号主键",required = true),
            @ApiImplicitParam(name = "gro_Com_Name",value = "组合商品名称",required = true),
            @ApiImplicitParam(name = "gro_Com_Cla",value = "商品分类",required = true),
            @ApiImplicitParam(name = "gro_Com_Price",value = "组合商品价格",required = true),
            @ApiImplicitParam(name = "gro_Com_Putaway_Date",value = "上架日期",required = true),
            @ApiImplicitParam(name = "gro_Com_Status",value = "状态（1:上架,2:下架,3:删除）默认1",required = true),
            @ApiImplicitParam(name = "gro_Com_Details",value = "商品详情（组合商品以 商品1编号+商品2编号... 形式）/(以单独商品编号)",required = true),
            @ApiImplicitParam(name = "gro_Com_Create_Date",value = "创建时间（可前端传输，也可后端直接获取系统当前时间）",required = true),
            @ApiImplicitParam(name = "gro_Com_Remark",value = "备注",required = true)
    })
    @ResponseBody
    public R updateGroupCommodity(GroupCommodity groupCommodity){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 删除商品
     * */
    @RequestMapping(value = "/commodity/delGroupCommodity",method = RequestMethod.POST)
    @ApiOperation(value = "删除组合商品",notes = "删除",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "gro_Com_Id",value = "组合商品编码",required = true )
    })
    @ResponseBody
    public R delGroupCommodity(String groComId){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }
}
